<?php include (dirname(__FILE__)."/../include/header.php");?>
<?php if(!isset($_SESSION['_user'])){header("location:../user_login.php");}?>
 <div class="container">
<ul class="breadcrumb">
         <li><a href="<?php echo SITE_ROOT; ?>">返回首页</a><span class="divider">/</span></li>
         <li><a href="<?php echo SITE_ROOT."/user/user_center.php"; ?>">个人中心</a></li>
      </ul>
<div class="row">
    <div class="span12 wash-paper user-center profile">
        <div class="row">
            <div class="span3">
<?php include (dirname(__FILE__)."/../include/user/left.php"); ?>
            <div class="span9">
                <div class="main-content">
                  <div class="content-header">
  <h3>个人中心 - <?php echo $_SESSION['_user']['username'];?></h3>
</div>
<div class="content-inner">
    <h4>账户信息</h4>
    <div class="account-info">
    <table class="table account-info-table table-striped table-bordered">
        <tr>
            <td class="col-name">用户名：</td>
            <td><?php echo $_SESSION['_user']['username'];?></td>
            <td class="col-name">Email：</td>
            <td><?php echo $_SESSION['_user']['mail'];?></td>
        </tr>
        <tr>
            <td class="col-name">完成点单：</td>
            <td>
			<?php
				$sql=mysql_query("select ord_id from zy_order where user_id=".$_SESSION['_user']['user_id']);
				$row=mysql_num_rows($sql);
				echo $row;
			?>
			次&nbsp;&nbsp;</td>
            <td class="col-name">吃过美食：</td>
            <td>
			<?php
				$sql1=mysql_query("SELECT distinct b.food_id num FROM zy_order a,zy_item b WHERE user_id=".$_SESSION['_user']['user_id']." AND a.`ord_id`=b.`order_id`");
				$rs1=mysql_num_rows($sql1);
				echo $rs1;
			?>
			份</td>
        </tr>
        <tr>
            <td class="col-name">总积分：</td>
            <td><?php $sql2="select * from zy_user where user_id=".$_SESSION['_user']['user_id']."";
            		$result2=mysql_query($sql2);
            		while($zy_user=mysql_fetch_array($result2)){
            			echo $zy_user['integral'];
            		}
            
            ?>点&nbsp;&nbsp;<a href="<?php echo SITE_ROOT."/gift";?>">兑换礼品</a></td>
            <td class="col-name">注册时间：</td>
            <td><?php echo $_SESSION['_user']['user_create_time'];?></td>
        </tr>
    </table>
    </div>
    </div>
                </div>
            </div>
        </div>
    </div>
</div>
                      <a id="back-to-top" href="javascript:void(0);">
              <div class="backtotop"></div>
            </a>
                  </div>
<?php include (dirname(__FILE__)."/../include/footer.php"); ?>
